//
//  SS_BaseNavigationController.swift
//  SSNews
//
//  Created by 叶竞泽 on 2017/4/30.
//  Copyright © 2017年 叶竞泽. All rights reserved.
//

import UIKit

class SS_BaseNavigationController: UINavigationController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // 修改navigationBar样式
        view.backgroundColor = UIColor.white
        navigationBar.barTintColor = mainRed
        navigationBar.tintColor = mainWhite
        navigationBar.titleTextAttributes = [NSForegroundColorAttributeName : mainWhite]
    }
    
    override var preferredStatusBarStyle: UIStatusBarStyle {
        return .lightContent
    }
    
    /// 如果不是根控制器,就隐藏tabbar
    override func pushViewController(_ viewController: UIViewController, animated: Bool) {
        if childViewControllers.count != 0 {
            viewController.hidesBottomBarWhenPushed = true
        }
        super.pushViewController(viewController, animated: animated)
    }

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
